Use xm create's --dryrun option to get the name from the configuration file,
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Wed, 7 Dec 2005 16:25:13 +0000 (16:25 +0000)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Wed, 7 Dec 2005 16:25:13 +0000 (16:25 +0000)
rather than the eversoskanky approach taken previously (use grep, and replace
any occurrences of %d with [0-9]* !)

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/examples/init.d/xendomains

index 23d53efea415e2f1157224230ee74e8950ac4770..3e8155fcd95424498cf7b6df25b8e84d84e4d56c 100644 (file)
@@ -152,7 +152,8 @@ contains_something()
 # read name from xen config file
 rdname()
 {
-    NM=`grep '^name *=' $1 | sed -e 's/^name *= *"\([^"]*\)".*$/\1/' -e 's/%[id]/[0-9]*/g'`
+    NM=$(xm create --quiet --dryrun --defconfig "$1" |
+         sed -n 's/^.*(name \(.*\))$/\1/p')
 }
 
 rdnames()
@@ -220,6 +221,7 @@ start()
                rm $dom
            fi
        done
+       echo .
     fi
 
     if contains_something "$XENDOMAINS_AUTO"